const state = {
	id: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).id : '',
	collectionId: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).collectionId : '',
	name: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).name : '',
	img: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).img : '',
	content: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).content : '',
	authorName: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).authorName : '',
	hash: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).hash : '',
	contractAddress: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).contractAddress :
		'',
	type: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).type : '',
	status: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).status : '',
	holder: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).holder : '',
	number: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).number : '',
	price: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).price : '',
	discount: uni.getStorageSync('transfer') ? JSON.parse(uni.getStorageSync('transfer')).discount : '',
}
const mutations = {
	changeState(state, data) {
		state = Object.assign(state, data);
		uni.setStorageSync('transfer', JSON.stringify(data))
	},

}

export default {
	namespaced: true,
	state,
	mutations
}
